package com.socio.resources;

import java.util.Collections;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import net.sf.jsr107cache.Cache;
import net.sf.jsr107cache.CacheException;
import net.sf.jsr107cache.CacheManager;

@Path("/hooks")
public class HooksResource {

	//@Path("/clearCache")
    @GET
    @Produces(MediaType.TEXT_PLAIN)
    public String clearCache() {
		
        Cache cache = null;
        try {
	        cache = CacheManager.getInstance().getCacheFactory().createCache(Collections.emptyMap());
        } catch (CacheException e) {}
        cache.clear();
        
        return "cache cleared";
	}
}
